package org.geohunter.activity.osmmap;

import org.andnav.osm.DefaultResourceProxyImpl;
import org.andnav.osm.ResourceProxy;
import org.geohunter.R;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;

public class ResourceProxyImpl extends DefaultResourceProxyImpl {
    private final Context mContext;
    public ResourceProxyImpl(Context context) {
        super(context);
        mContext = context;
    }
    
    @Override
    public Bitmap getBitmap(bitmap pResId) {
        if (pResId == ResourceProxy.bitmap.person)
            return BitmapFactory.decodeResource(mContext.getResources(), R.drawable.person);
        return super.getBitmap(pResId);
    }
    
    @Override
    public Drawable getDrawable(final bitmap pResId) {
        if (pResId == ResourceProxy.bitmap.person)
            return mContext.getResources().getDrawable(R.drawable.person);
        return super.getDrawable(pResId);
    }
}

